/*
 * $Id: ColorManager.java 152 2009-05-19 10:46:22Z meyer@alphatec.de $
 * 
 *
 * Copyright 2009 DeltaDesk
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package deltadesk.gui.deltagui.style;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/**
 * ColorManager.
 * 
 * @author Andreas Meyer
 * @version $Revision: 152 $
 */
public class ColorManager {
	
	/**
	 * Map for color bundles.
	 */
	private static final Map<String, ColorBundle> map = 
		new HashMap<String, ColorBundle>(10);
	
	
	/**
	 * Register a color scheme.
	 * 
	 * @param cb
	 */
	public static void register(final ColorBundle cb) {
		map.put(cb.getName(), cb);
	}
	
	/**
	 * Resolve a color schema by its name.
	 * 
	 * @param name
	 * @return
	 */
	public static ColorBundle get(final String name) {
		return map.get(name);
	}
	
	/**
	 * Return a list with all names of the color schemes.
	 *  
	 * @return
	 */
	public static List<String> getSchemeNames() {
		
		final List<String> result = new LinkedList<String>();
		result.addAll(map.keySet());
		return result;
	}

}
